home *** CD-ROM | disk | FTP | other *** search
/ Skunkware 5 / Skunkware 5.iso / src / X11 / xmcd-1.4 / libdi.d / vu_nec.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-05-10  |  4.9 KB  |  165 lines

  1. /*
  2.  *   libdi - CD Audio Player Device Interface Library
  3.  *
  4.  *   Copyright (C) 1995  Ti Kan
  5.  *   E-mail: ti@amb.org
  6.  *
  7.  *   This program is free software; you can redistribute it and/or modify
  8.  *   it under the terms of the GNU General Public License as published by
  9.  *   the Free Software Foundation; either version 2 of the License, or
  10.  *   (at your option) any later version.
  11.  *
  12.  *   This program is distributed in the hope that it will be useful,
  13.  *   but WITHOUT ANY WARRANTY; without even the implied warranty of
  14.  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  15.  *   GNU General Public License for more details.
  16.  *
  17.  *   You should have received a copy of the GNU General Public License
  18.  *   along with this program; if not, write to the Free Software
  19.  *   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  20.  *
  21.  *   The name "NEC" is a trademark of NEC Corporation, and is used here
  22.  *   for identification purposes only.  This software and its author
  23.  *   are not affiliated in any way with NEC.
  24.  *
  25.  */
  26. #ifndef __VU_NEC_H__
  27. #define __VU_NEC_H__
  28.  
  29. #ifdef VENDOR_NEC
  30.  
  31. #ifndef LINT
  32. static char *_vu_nec_h_ident_ = "@(#)vu_nec.h    5.2 94/12/28";
  33. #endif
  34.  
  35.  
  36. /* NEC vendor-unique commands */
  37. #define OP_VN_AUDSRCH        0xd8    /* NEC audio search */
  38. #define OP_VN_AUDPLAY        0xd9    /* NEC play audio */
  39. #define OP_VN_STILL        0xda    /* NEC still */
  40. #define OP_VN_SETSTOP        0xd8    /* NEC set stop time */
  41. #define OP_VN_EJECT        0xdc    /* NEC eject */
  42. #define OP_VN_RDSUBQ        0xdd    /* NEC read subcode Q */
  43. #define OP_VN_RDTOC        0xde    /* NEC read TOC */
  44.  
  45.  
  46. /* NEC audio status codes */
  47. #define NAUD_PLAYING        0x00
  48. #define NAUD_PAUSED        0x01
  49. #define NAUD_SRCH_PAUSED    0x02
  50. #define NAUD_COMPLETED        0x03
  51.  
  52.  
  53. /* Return data lengths */
  54. #define SZ_VN_RDSUBQ        10    /* NEC read subcode Q data size */
  55. #define SZ_VN_RDTOC        4    /* NEC read TOC data size */
  56.  
  57.  
  58. /* NEC read sub-code Q command data */
  59. typedef struct nsubq_data {
  60.     unsigned int    audio_status:8;    /* audio status */
  61. #if _BYTE_ORDER_ == _L_ENDIAN_
  62.     unsigned int    preemph:1;    /* preemphasis */
  63.     unsigned int    copyallow:1;    /* digital copy allow */
  64.     unsigned int    trktype:1;    /* 0=audio 1=data */
  65.     unsigned int    audioch:1;    /* 0=2ch 1=4ch */
  66.     unsigned int    reserved:4;    /* reserved */
  67. #else    /* _BYTE_ORDER_ == _B_ENDIAN_ */
  68.     unsigned int    reserved:4;    /* reserved */
  69.     unsigned int    audioch:1;    /* 0=2ch 1=4ch */
  70.     unsigned int    trktype:1;    /* 0=audio 1=data */
  71.     unsigned int    copyallow:1;    /* digital copy allow */
  72.     unsigned int    preemph:1;    /* preemphasis */
  73. #endif    /* _BYTE_ORDER_ */
  74.     unsigned int    trkno:8;    /* track number (BCD) */
  75.     unsigned int    idxno:8;    /* index number (BCD) */
  76.  
  77.     byte_t        rel_min;    /* trk relative minutes (BCD) */
  78.     byte_t        rel_sec;    /* trk relative seconds (BCD) */
  79.     byte_t        rel_frame;    /* trk relative frame (BCD) */
  80.     byte_t        abs_min;    /* absolute minutes (BCD) */
  81.  
  82.     byte_t        abs_sec;    /* absolute seconds (BCD) */
  83.     byte_t        abs_frame;    /* absolute frame (BCD) */
  84.     byte_t        pad1[2];    /* pad for alignment */
  85. } nsubq_data_t;
  86.  
  87.  
  88. /* NEC read TOC command data */
  89. typedef struct ninfo_00 {        /* track information */
  90.     byte_t        first_trk;    /* first track (BCD) */
  91.     byte_t        last_trk;    /* last track (BCD) */
  92.     byte_t        reserved[2];    /* reserved */
  93. } ninfo_00_t;
  94.  
  95. typedef struct ninfo_01 {        /* lead-out track starting time */
  96.     byte_t        min;        /* minutes (BCD) */
  97.     byte_t        sec;        /* seconds (BCD) */
  98.     byte_t        frame;        /* frame (BCD) */
  99.     byte_t        reserved;    /* reserved */
  100. } ninfo_01_t;
  101.  
  102. typedef struct ninfo_02 {        /* specified track starting time */
  103.     byte_t        min;        /* minutes (BCD) */
  104.     byte_t        sec;        /* seconds (BCD) */
  105.     byte_t        frame;        /* frame (BCD) */
  106.     byte_t        trktype;    /* track type */
  107. } ninfo_02_t;
  108.  
  109.  
  110. /* Argument of NEC audio search and play audio commands */
  111. typedef struct naudio_arg {
  112.     union {                /* address */
  113.         word32_t    tp_00;    /* absolute logical blk addr */
  114. #if _BYTE_ORDER_ == _L_ENDIAN_
  115.         struct {
  116.             byte_t    res;    /* reserved */
  117.             byte_t    frame;    /* frame (BCD) */
  118.             byte_t    sec;    /* seconds (BCD) */
  119.             byte_t    min;    /* minutes (BCD) */
  120.         } tp_01;
  121.         struct {
  122.             byte_t    res[3];    /* reserved */
  123.             byte_t    track;    /* track number (BCD) */
  124.         } tp_10;
  125. #else    /* _BYTE_ORDER_ == _B_ENDIAN_ */
  126.         struct {
  127.             byte_t    min;    /* minutes (BCD) */
  128.             byte_t    sec;    /* seconds (BCD) */
  129.             byte_t    frame;    /* frame (BCD) */
  130.             byte_t    res;    /* reserved */
  131.         } tp_01;
  132.         struct {
  133.             byte_t    track;    /* track number (BCD) */
  134.             byte_t    res[3];    /* reserved */
  135.         } tp_10;
  136. #endif    /* _BYTE_ORDER_ */
  137.     } _addr;
  138. } naudio_arg_t;
  139.  
  140. #define    addr_logical    _addr.tp_00
  141. #define    addr_min    _addr.tp_01.min
  142. #define    addr_sec    _addr.tp_01.sec
  143. #define    addr_frame    _addr.tp_01.frame
  144. #define    addr_track    _addr.tp_10.track
  145.  
  146.  
  147. /* Public function prototypes */
  148. extern bool_t    nec_playaudio(byte_t, word32_t, word32_t, msf_t *, msf_t *,
  149.             byte_t, byte_t);
  150. extern bool_t    nec_pause_resume(bool_t);
  151. extern bool_t    nec_get_playstatus(curstat_t *, byte_t *);
  152. extern bool_t    nec_get_toc(curstat_t *);
  153. extern bool_t    nec_mute(bool_t);
  154. extern bool_t    nec_eject(void);
  155. extern void    nec_init(void);
  156.  
  157. #else
  158.  
  159. #define nec_init    NULL
  160.  
  161. #endif    /* VENDOR_NEC */
  162.  
  163. #endif    /* __VU_NEC_H__ */
  164.  
  165.